package com.fpt.mockproject.j21.absd.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicUpdate;

@Entity
@Table(name = "ADDRESS")
@DynamicUpdate(value = true)
public class Address {
	
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "AddressID", nullable = false, updatable = false, unique = true)
	private Long addressID;
	
	@Column(name = "ShortDesc", nullable = false)
	private String shortDesc;
	
	@Column(name = "AddressLine_1", nullable = false)
	private String addressLine_1;
	
	@Column(name = "AddressLine_2")
	private String addressLine_2;
	
	@Column(name = "AddressLine_3")
	private String addressLine_3;
	
	@Column(name = "FullDesc", nullable = false)
	private String fullDesc;
	
	@Column(name = "PhoneNumber", nullable = false)
	private String phoneNumber;
	
	@Column(name = "Email")
	private String email;
	
	@Column(name = "WebAddress")
	private String webAddress;
	
	@Column(name = "Fax")
	private String fax;
	
	@Column(name = "CharityNumber")
	private String charityNumber;
	
	@Column(name = "CompanyNumber")
	private String companyNumber;
	
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinColumn(name = "ContactID")
	private Contact contact;
	
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinColumn(name = "CountryID")
	private Country country;
	
	@ManyToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinColumn(name = "TypeOfBusinessID")
	private TypeOfBusiness typeOfBusiness;
	
	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "address")
	private Set<Department> departments = new HashSet<>(0);
	
	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "address")
	private Set<Directorate> directorates = new HashSet<>(0);
	
	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "address")
	private Set<Organisation> organisations = new HashSet<>(0);
	
	@OneToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL, mappedBy = "address")
	private Set<Team> teams = new HashSet<>(0);
	
	public Set<Team> getTeams() {
		return teams;
	}
	public void setTeams(Set<Team> teams) {
		this.teams = teams;
	}
	public Set<Organisation> getOrganisations() {
		return organisations;
	}
	public void setOrganisations(Set<Organisation> organisations) {
		this.organisations = organisations;
	}
	public Set<Directorate> getDirectorates() {
		return directorates;
	}
	public void setDirectorates(Set<Directorate> directorates) {
		this.directorates = directorates;
	}
	public Set<Department> getDepartments() {
		return departments;
	}
	public void setDepartments(Set<Department> departments) {
		this.departments = departments;
	}
	public Contact getContact() {
		return contact;
	}
	public void setContact(Contact contact) {
		this.contact = contact;
	}
	public Country getCountry() {
		return country;
	}
	public void setCountry(Country country) {
		this.country = country;
	}
	public TypeOfBusiness getTypeOfBusiness() {
		return typeOfBusiness;
	}
	public void setTypeOfBusiness(TypeOfBusiness typeOfBusiness) {
		this.typeOfBusiness = typeOfBusiness;
	}
	public Long getAddressID() {
		return addressID;
	}
	public void setAddressID(Long addressID) {
		this.addressID = addressID;
	}
	public String getShortDesc() {
		return shortDesc;
	}
	public void setShortDesc(String shortDesc) {
		this.shortDesc = shortDesc;
	}
	public String getAddressLine_1() {
		return addressLine_1;
	}
	public void setAddressLine_1(String addressLine_1) {
		this.addressLine_1 = addressLine_1;
	}
	public String getAddressLine_2() {
		return addressLine_2;
	}
	public void setAddressLine_2(String addressLine_2) {
		this.addressLine_2 = addressLine_2;
	}
	public String getAddressLine_3() {
		return addressLine_3;
	}
	public void setAddressLine_3(String addressLine_3) {
		this.addressLine_3 = addressLine_3;
	}
	public String getFullDesc() {
		return fullDesc;
	}
	public void setFullDesc(String fullDesc) {
		this.fullDesc = fullDesc;
	}
	public String getPhoneNumber() {
		return phoneNumber;
	}
	public void setPhoneNumber(String phoneNumber) {
		this.phoneNumber = phoneNumber;
	}
	public String getEmail() {
		return email;
	}
	public void setEmail(String email) {
		this.email = email;
	}
	public String getWebAddress() {
		return webAddress;
	}
	public void setWebAddress(String webAddress) {
		this.webAddress = webAddress;
	}
	public String getFax() {
		return fax;
	}
	public void setFax(String fax) {
		this.fax = fax;
	}
	public String getCharityNumber() {
		return charityNumber;
	}
	public void setCharityNumber(String charityNumber) {
		this.charityNumber = charityNumber;
	}
	public String getCompanyNumber() {
		return companyNumber;
	}
	public void setCompanyNumber(String companyNumber) {
		this.companyNumber = companyNumber;
	}
}
